package cupk;

import java.util.List;

public class ProductList extends AbstractObjectList{
    public ProductList(List<Object> objects) {
        super(objects);
    }

    @Override
    public void addObject(Object obj) {
        System.out.println("产品列表添加了产品：" + obj);
        this.objects.add(obj);
    }

    @Override
    public void removeObject(Object obj) {
        System.out.println("产品列表移除了产品：" + obj);
        this.objects.remove(obj);
    }

    @Override
    public List getObjects() {
        System.out.println("获取产品列表");
        return this.objects;
    }

    @Override
    public AbstractIterator createIterator() {
        return new ProductIterator(this);
    }
}
